package com.dx_society.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import lombok.Data;

/**
 * 活动评论表
 *
 * @TableName dx_activity_comment
 */
@TableName(value = "dx_activity_comment")
@Data
public class ActivityComment implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 活动id
     */
    private Long acId;
    /**
     * 内容
     */
    private String context;

    /**
     * 发表时间
     */
    private Date sendtime;

    /**
     * 用户id
     */
    private Long sendUserId;

    /**
     * 发送者名称
     */
    private String sendUserName;

    /**
     * 审核状态（0审核中，1已通过，2已驳回）
     */
    private Integer state;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ActivityComment other = (ActivityComment) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getAcId() == null ? other.getAcId() == null : this.getAcId().equals(other.getAcId()))
                && (this.getContext() == null ? other.getContext() == null : this.getContext().equals(other.getContext()))
                && (this.getSendtime() == null ? other.getSendtime() == null : this.getSendtime().equals(other.getSendtime()))
                && (this.getSendUserId() == null ? other.getSendUserId() == null : this.getSendUserId().equals(other.getSendUserId()))
                && (this.getSendUserName() == null ? other.getSendUserName() == null : this.getSendUserName().equals(other.getSendUserName()))
                && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAcId() == null) ? 0 : getAcId().hashCode());
        result = prime * result + ((getContext() == null) ? 0 : getContext().hashCode());
        result = prime * result + ((getSendtime() == null) ? 0 : getSendtime().hashCode());
        result = prime * result + ((getSendUserId() == null) ? 0 : getSendUserId().hashCode());
        result = prime * result + ((getSendUserName() == null) ? 0 : getSendUserName().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", acId=").append(acId);
        sb.append(", context=").append(context);
        sb.append(", sendtime=").append(sendtime);
        sb.append(", sendUserId=").append(sendUserId);
        sb.append(", sendUserName=").append(sendUserName);
        sb.append(", state=").append(state);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}